//选择甲方
function selectOwner(){
    debugger;
    $.modal.open("选择甲方",ctx + "partner/tenementInfo",1200,($(window).height() - 50),function (index, layero) {
        var rows = layero.find('iframe')[0].contentWindow.getSelectionRadio();
        if(rows.length == 0){
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }else{
            $("input[name='ownerDeptId']").val(rows[0].deptId);
            $("input[name='owner']").val(rows[0].deptName);
            $("input[name='ownerName']").val(rows[0].leader);
            $("input[name='ownerPhone']").val(rows[0].phone);
            $("input[name='ownerAddress']").val(rows[0].address);
            $.modal.close(index);
        }
    });
}

//选择乙方
function selectBuy(){
    debugger;
    $.modal.open("选择乙方",ctx + "partner/tenementInfo",1200,($(window).height() - 50),function (index, layero) {
        var rows = layero.find('iframe')[0].contentWindow.getSelectionRadio();
        if(rows.length == 0){
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }else{
            $("input[name='buyDeptId']").val(rows[0].deptId);
            $("input[name='buy']").val(rows[0].deptName);
            $("input[name='buyName']").val(rows[0].leader);
            $("input[name='buyPhone']").val(rows[0].phone);
            $("input[name='buyAddress']").val(rows[0].address);
            $.modal.close(index);
        }
    });
}
